function res = gabortest3(img, f, S, K, verbose)
if nargin < 2
    f = 1/4;
end
if nargin < 3
    S = 6;
end
if nargin < 4
    K = 8;
end
if nargin < 5
    verbose = 0;
end
img = squeeze(img);
gaborBank = sg_createfilterbank(size(img),f, S, K, 'pf',0.9);
fResp2 = sg_filterwithbank2(img,gaborBank);% Filter with the filter bank

miu_s = nan(S,K);
sigma_s = nan(S,K);

for freqInd = 1:size(fResp2.freq,2)
  for orientInd = 1:size(fResp2.freq{1}.resp,1)
    C = squeeze(fResp2.freq{freqInd}.resp(orientInd,:,:));
    A = abs(C);
    miu_s(freqInd, orientInd)=mean(A(:));
    sigma_s(freqInd, orientInd)=std(A(:));
    if verbose
        R = real(C);
        I = imag(C);
        imshow(A,[]);
        pause;
    end
  end;
end;
res = [miu_s(:)' sigma_s(:)'];